package com.aigis.big4.tmp.javase;

public final class Immutable {
    private final int[] myArray;

    public Immutable(int[] myArray) {
        //采用深度拷贝的方法来复制一个对象并传入副本的引用来确保类的不可变
        this.myArray = myArray.clone();
        //错误示范
        //this.myArray = myArray.clone();
    }
}
